<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>首页-工作质效</title>
    <link rel="stylesheet" href="/layui/css/layui.css">
    <link rel="stylesheet" href="/css/custom.form.css">
    <script type="text/javascript" src="/js/main/jquery.js"></script>
    <script src="/layui/layui.all.js" charset="utf-8"></script>
    <script src="/js/jquery.min.js"></script>
    <script src="/js/core.util.js"></script>
    <style>
        .layui-table-cell {
            min-height: 30px;
            height: initial;
        }

        .layui-table-cell, .layui-table-tool-panel li {
            white-space: initial;
            /*为了让字母和数字也换行*/
            word-break: break-word;
        }
    </style>
</head>
<body>
<!--案件执行情况-->
<div class="layui-tab table_div">
    <ul class="layui-tab-title">
        <li class="layui-this" id="grdb">工作质效</li>
        <li id="gryb">案件执行情况</li>
    </ul>
    <div class="layui-tab-content">
        <div class="layui-tab-item layui-show">
            <div id="content" style="width: 100%;">
                <input type="hidden" th:value="${key}" id="key"/>
                <div class="row-fluid">
                    <div class="widget-box">
                        <div class="widget-title bg_lg">
                        </div>
                        <div class="widget-content">
                            <div class="row-fluid">
                                <div class="span12">
                                    <table class="layui-table" id="gzzxShowTable" lay-filter="gzzxShowTable"></table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div id="level2_jcgxjf_div" hidden>
                    <table class="layui-hide" id="level2_jcgxjf_table" lay-filter="level2_jcgxjf_table" hidden></table>
                </div>

                <div id="level2_zfxnjf_div" hidden>
                    <table class="layui-hide" id="level2_zfxnjf_table" lay-filter="level2_zfxnjf_table" hidden></table>
                </div>

                <div id="level2_cgyyjf_div" hidden>
                    <table class="layui-hide" id="level2_cgyyjf_table" lay-filter="level2_cgyyjf_table" hidden></table>
                </div>

                <div id="level2_qtxmjf_div" hidden>
                    <table class="layui-hide" id="level2_qtxmjf_table" lay-filter="level2_qtxmjf_table" hidden></table>
                </div>

                <div id="level2_ksfzrjf_div" hidden>
                    <table class="layui-hide" id="level2_ksfzrjf_table" lay-filter="level2_ksfzrjf_table"
                           hidden></table>
                </div>

                <div id="level3_jccbjfmx_div" hidden>
                    <table class="layui-hide" id="level3_jccbjfmx_table" lay-filter="level3_jccbjfmx_table"
                           hidden></table>
                </div>
                <div id="level3_jcrkjfmx_div" hidden>
                    <table class="layui-hide" id="level3_jcrkjfmx_table" lay-filter="level3_jcrkjfmx_table"
                           hidden></table>
                </div>
                <div id="level3_ajccsxjfmx_div" hidden>
                    <table class="layui-hide" id="level3_ajccsxjfmx_table" lay-filter="level3_ajccsxjfmx_table"
                           hidden></table>
                </div>
                <div id="level3_ajdxjfmx_div" hidden>
                    <table class="layui-hide" id="level3_ajdxjfmx_table" lay-filter="level3_ajdxjfmx_table"
                           hidden></table>
                </div>
                <div id="level3_dchsajjfmx_div" hidden>
                    <table class="layui-hide" id="level3_dchsajjfmx_table" lay-filter="level3_dchsajjfmx_table"
                           hidden></table>
                </div>
                <div id="level3_dbajjfmx_div" hidden>
                    <table class="layui-hide" id="level3_dbajjfmx_table" lay-filter="level3_dbajjfmx_table"
                           hidden></table>
                </div>
            </div>
        </div>
        <div class="layui-tab-item">
            <table class="layui-table" id="ajzxqkTable" lay-filter="ajzxqkTable"></table>
        </div>
    </div>
</div>

</body>
</html>
<script type="text/html" id="toolbar">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-primary" lay-event="returnBack">返回</button>
    </div>
</script>
<script th:inline="none">
    // 获取token
    let token = CoreUtil.getData("access_token");
    // 地址栏转义token中的#号
    let tokenQuery = token.replace("#", "%23");
    let gzzxShowTable;
    let table = layui.table;
    let form = layui.form;
    let layer = layui.layer;
    let $ = jQuery = layui.jquery;
    let laydate = layui.laydate;
    let upload = layui.upload;
    let element = layui.element;
    let levelFirst_table;
    let ajzxqkTable;
    let tableMerge = layui.tableMerge;
    $(function () {
        let key = $("#key").val();
        let colsTmp = [[
            {align: 'center', field: 'swjgdm', title: '税务机关代码', hide: true},
            {align: 'center', field: 'swjgmc', title: '机关名称', width: 140},
            {align: 'center', field: 'jczf', title: '稽查总分', width: 140/* totalRowText: '合计：'*/},
            {
                align: 'center',
                field: 'kspjjf',
                width: 140,
                title: '平均积分',/* totalRow: '{{parseInt(d.TOTAL_NUMS)}}',*/
                sort: true,
            },
            {align: 'center', field: 'qjpm', width: 100, title: '排名'},
            {align: 'center', field: 'jbx', width: 100, title: '稽比析'},
            {
                align: 'center',
                field: 'jcgxjf',
                title: '稽查贡献积分',
                width: 140,
                style: 'cursor:pointer;text-decoration:underline',
                event: 'JCGXJF'
            },
            {
                align: 'center',
                field: 'zfxnjf',
                title: '执法效能积分',
                width: 140,
                style: 'cursor:pointer;text-decoration:underline',
                event: 'ZFXNJF'
            },
            {
                align: 'center',
                field: 'cgyyjf',
                title: '成果运用积分',
                width: 140,
                style: 'cursor:pointer;text-decoration:underline',
                event: 'CGYYJF'
            },
            {
                align: 'center',
                field: 'qtxmjf',
                title: '其他项目积分',
                width: 140,
                style: 'cursor:pointer;text-decoration:underline',
                event: 'QTXMJF'
            },
            {
                align: 'center',
                field: 'ksfzrjf',
                title: '负责人积分',
                width: 140,
                style: 'cursor:pointer;text-decoration:underline',
                event: 'KSFZRJF'
            }
        ]];
        if ("jz" == key) {
            colsTmp = [[
                {align: 'center', field: 'swjgdm', title: '税务机关代码', hide: true},
                {
                    align: 'center',
                    field: 'swjgmc',
                    style: 'cursor:pointer;text-decoration:underline',
                    event: 'JCJXZKS',
                    title: '机关名称',
                    width: 140
                },
                {align: 'center', field: 'jczf', title: '稽查总分', width: 140},
                {align: 'center', field: 'kspjjf', width: 140, title: '平均积分'},
                {align: 'center', field: 'qjpm', width: 100, title: '排名',},
                {align: 'center', field: 'jbx', width: 100, title: '稽比析'},
                {align: 'center', field: 'jcgxjf', title: '稽查贡献积分', width: 140},
                {align: 'center', field: 'zfxnjf', title: '执法效能积分', width: 140},
                {align: 'center', field: 'cgyyjf', title: '成果运用积分', width: 140},
                {align: 'center', field: 'qtxmjf', title: '其他项目积分', width: 140},
                {align: 'center', field: 'ksfzrjf', title: '负责人积分', width: 140}
            ]];
        }
        gzzxShowTableLoad(colsTmp);

        function gzzxShowTableLoad(colsTmp) {
            levelFirst_table = table.render({
                elem: '#gzzxShowTable',
                id: 'gzzxShowTable',
                contentType: 'application/json',
                headers: {
                    "authorization": token
                },
                cols: colsTmp,
                toolbar: '#toolbar',
                page: false,// 开启分页
                url: '/statistics/gzzx/firstLevel', //数据接口
                method: 'POST',
                parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
                    return {
                        "code": res.code, //解析接口状态
                        "msg": res.msg, //解析提示文本
                        "count": 10000, //解析数据长度
                        "data": CoreUtil.isEmpty(res.data) ? null
                            : CoreUtil.paramsDecrypt(res.data.tableDatas)
                    }
                },
            });
        }
    });
    layui.config({
        base: '/'
    }).extend({
        tableMerge: 'layui-ext/tableMerge/tableMerge'
    }).use(['table', 'layer', 'laydate', 'upload', 'element', 'tableMerge'], function () {

        //案件执行情况
        ajzxqkTable = table.render({
            elem: '#ajzxqkTable'
            , contentType: 'application/json'
            , headers: {"authorization": token}
            , url: '/statistics/queryJbx' //数据接口
            , method: 'POST'
            , parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
                console.log("res:", res)
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.msg, //解析提示文本
                    "count": CoreUtil.isEmpty(res.data) ? 0 : res.data.total, //解析数据长度
                    "data": CoreUtil.isEmpty(res.data) ? null : res.data //解析数据列表
                }
            }
            , cols: [
                [
                    {field: 'dw', title: '单位', width: 180, align: "center"},
                    {field: 'cbze', title: '查补总额', width: 180, align: "center"},
                    {field: 'cbzzl', title: '查补增长率', width: 180, align: "center"},
                    {field: 'rkze', title: '入库总额', width: 180, align: "center"},
                    {field: 'rkzzl', title: '入库增长率', width: 180, align: "center"},
                    {field: 'xazql', title: '选案准确率', width: 180, align: "center"},
                    {field: 'rkl', title: '入库率', width: 180, align: "center"},
                    {field: 'sjl', title: '审结率', width: 180, align: "center"},
                    {field: 'rjjchs', title: '人均检查户数', width: 180, align: "center"},
                    {field: 'rjcbze', title: '人均查补总额', width: 180, align: "center"},
                    {field: 'hjcbze', title: '户均查补总额', width: 180, align: "center"},
                    {field: 'cbeywfajhs', title: '查补恶意违法案件户数', width: 180, align: "center"},
                    {field: 'cbzezh', title: '查补总额之和', width: 180, align: "center"},
                    {field: 'pjbasc', title: '平均办案时长', width: 180, align: "center"}
                ]
            ]
            , toolbar: '#toolbar'
        });


        table.on('tool(gzzxShowTable)', function (obj) {
            let event = obj.event;
            let swjgDm = obj.data.swjgdm;
            if (event === "JCGXJF") {
                renderXzTable(obj, 2);
                openXzDiv('稽查贡献积分', 'level2_jcgxjf_div');
            } else if (event === "ZFXNJF") {
                renderXzTable(obj, 2);
                openXzDiv('执法效能积分', 'level2_zfxnjf_div');
            } else if (event === "CGYYJF") {
                renderXzTable(obj, 2);
                openXzDiv('成果运用积分', 'level2_cgyyjf_div');
            } else if (event === "QTXMJF") {
                renderXzTable(obj, 2);
                openXzDiv('其他项目积分', 'level2_qtxmjf_div');
            } else if (event === "KSFZRJF") {
                renderXzTable(obj, 2);
                openXzDiv('科室负责人积分', 'level2_ksfzrjf_div');
            } else if (event === "JCJXZKS") {//稽查局下钻到科室 还是理论上还是一级数据
                let colsTmp = [[
                    {align: 'center', field: 'swjgdm', title: '税务机关代码', hide: true},
                    {align: 'center', field: 'swjgmc', title: '机关名称', width: 140},
                    {align: 'center', field: 'jczf', title: '稽查总分', width: 140},
                    {align: 'center', field: 'kspjjf', width: 140, title: '平均积分'},
                    {align: 'center', field: 'qjpm', width: 100, title: '排名'},
                    {align: 'center', field: 'jbx', width: 100, title: '稽比析'},
                    {
                        align: 'center',
                        field: 'jcgxjf',
                        title: '稽查贡献积分',
                        width: 140,
                        style: 'cursor:pointer;text-decoration:underline',
                        event: 'JCGXJF'
                    },
                    {
                        align: 'center',
                        field: 'zfxnjf',
                        title: '执法效能积分',
                        width: 140,
                        style: 'cursor:pointer;text-decoration:underline',
                        event: 'ZFXNJF'
                    },
                    {
                        align: 'center',
                        field: 'cgyyjf',
                        title: '成果运用积分',
                        width: 140,
                        style: 'cursor:pointer;text-decoration:underline',
                        event: 'CGYYJF'
                    },
                    {
                        align: 'center',
                        field: 'qtxmjf',
                        title: '其他项目积分',
                        width: 140,
                        style: 'cursor:pointer;text-decoration:underline',
                        event: 'QTXMJF'
                    },
                    {
                        align: 'center',
                        field: 'ksfzrjf',
                        title: '负责人积分',
                        width: 140,
                        style: 'cursor:pointer;text-decoration:underline',
                        event: 'KSFZRJF'
                    }
                ]];
                table.render({
                    elem: '#gzzxShowTable',
                    id: 'gzzxShowTable',
                    contentType: 'application/json',
                    headers: {
                        "authorization": token
                    },
                    cols: colsTmp,
                    toolbar: '#toolbar',
                    page: false,// 开启分页
                    where: {swjgDm: swjgDm},
                    url: '/statistics/gzzx/firstLevel', //数据接口
                    method: 'POST',
                    parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
                        return {
                            "code": res.code, //解析接口状态
                            "msg": res.msg, //解析提示文本
                            "count": 10000, //解析数据长度
                            "data": CoreUtil.isEmpty(res.data) ? null
                                : CoreUtil.paramsDecrypt(res.data.tableDatas)
                        }
                    },
                });
            }
        });

        function openXzDiv(title, divId) {
            layer.open({
                type: 1,
                skin: 'layui-layer-molv',
                title: title,
                area: ['100%', '100%'],
                shade: 0.8,
                shadeClose: true,
                content: jQuery("#" + divId),
                btn: ['取消'],
            });
        }

        function renderXzTable(obj, level) {
            let event = obj.event;
            let swjgDm = obj.data.swjgdm;
            let colsTmp;
            let elemTmp;
            let idTmp;
            let totalRowTmp = false;
            let pageTmp = false;
            let whereParam = {swjgDm: swjgDm, type: event};
            let myParesDataFunction = function (res) { //将原始数据解析成 table 组件所规定的数据
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.msg, //解析提示文本
                    "count": 10000, //解析数据长度
                    "data": CoreUtil.isEmpty(res.data) ? null
                        : CoreUtil.paramsDecrypt(res.data.tableDatas)
                }
            };
            if (event === "JCGXJF") {
                colsTmp = [[
                    {align: 'center', field: 'swjgmc', title: '机关名称'},
                    {align: 'center', field: 'swjgdm', title: '机关代码', hide: true},
                    {
                        align: 'center',
                        field: 'cbdf',
                        title: '稽查查补(退)贡献积分',
                        style: 'cursor:pointer;text-decoration:underline',
                        event: 'JCCBJF'
                    },
                    {
                        align: 'center',
                        field: 'rkdf',
                        title: '稽查入库贡献积分',
                        style: 'cursor:pointer;text-decoration:underline',
                        event: 'JCRKJF'
                    },
                    // {align: 'center', field: 'ZCRKDF',title: '稽查自查入库贡献积分'}
                ]];
                elemTmp = 'level2_jcgxjf_table';
                idTmp = 'level2_jcgxjf_table';
            } else if (event === "ZFXNJF") {
                colsTmp = [[
                    {align: 'center', field: 'swjgmc', title: '机关名称'},
                    {align: 'center', field: 'swjgdm', title: '机关代码', hide: true},
                    {
                        align: 'center',
                        field: 'ccsxjf',
                        title: '案件查处时限积分',
                        style: 'cursor:pointer;text-decoration:underline',
                        event: 'AJCCSXJF'
                    },
                    {
                        align: 'center',
                        field: 'ajdxjf',
                        title: '案件定性积分',
                        style: 'cursor:pointer;text-decoration:underline',
                        event: 'AJDXJF'
                    }
                ]];
                elemTmp = 'level2_zfxnjf_table';
                idTmp = 'level2_zfxnjf_table';
            } else if (event === "CGYYJF") {
                colsTmp = [[
                    {align: 'center', field: 'swjgmc', title: '机关名称'},
                    {align: 'center', field: 'swjgdm', title: '机关代码', hide: true},
                    {align: 'center', field: 'jcajbh', title: '案件编号'},
                    {align: 'center', field: 'ajmc', title: '案件名称'},
                    {
                        align: 'center',
                        field: 'ajcccgjyzfxctjjf',
                        title: '案件查处成果和经验做法获得省部级以上表彰或者省部级以上媒体宣传推介积分'
                    },
                    {align: 'center', field: 'dxaldjyzfjf', title: '典型案例的经验做法积分'}
                ]];
                elemTmp = 'level2_cgyyjf_table';
                idTmp = 'level2_cgyyjf_table';
            } else if (event === "QTXMJF") {
                colsTmp = [[
                    {align: 'center', field: 'swjgmc', title: '机关名称'},
                    {align: 'center', field: 'swjgdm', title: '机关代码', hide: true},
                    {
                        align: 'center',
                        field: 'dchsajjf',
                        title: '调查核实案件积分',
                        style: 'cursor:pointer;text-decoration:underline',
                        event: 'DCHSAJJF'
                    },
                    {
                        align: 'center',
                        field: 'dbajjf',
                        title: '督办案件积分',
                        style: 'cursor:pointer;text-decoration:underline',
                        event: 'DBAJJF'
                    },
                    {align: 'center', field: 'qtjf', title: '其他积分'}
                ]];
                elemTmp = 'level2_qtxmjf_table';
                idTmp = 'level2_qtxmjf_table';
            } else if (event === "KSFZRJF") {
                colsTmp = [[
                    {align: 'center', field: 'kspjjf', merge: true, title: '科室平均积分'},
                    {align: 'center', field: 'swjgmc', title: '机关名称'},
                    {align: 'center', field: 'swjgdm', title: '机关代码', hide: true},
                    {align: 'center', field: 'jcajbh', title: '案件编号'},
                    {align: 'center', field: 'ajmc', title: '案件名称'},
                    {
                        align: 'center',
                        field: 'djjfsrxxgcddesdjs',
                        title: '党建积分－深入学习贯彻党的二十大精神，认真落实中央部署要求，扎实开展主题教育'
                    },
                    {align: 'center', field: 'djjfcjjczzdjppxsgz', title: '党建积分－参加基层组织党建品牌选树工作'},
                    {align: 'center', field: 'jjjf', title: '纪检积分'}
                ]];
                elemTmp = 'level2_ksfzrjf_table';
                idTmp = 'level2_ksfzrjf_table';
                // totalRowTmp = true;
                whereParam = {swjgDm: swjgDm, type: event, kspjjf: obj.data.KSPJJF};
            }
            //下面是三级 未完成
            else if (event === "JCCBJF") {
                colsTmp = [[
                    {align: 'center', field: 'jcry', title: '检查人员'},
                    {align: 'center', field: 'jcajbh', title: '案件编号'},
                    {align: 'center', field: 'ajmc', title: '案件名称'},
                    {align: 'center', field: 'ajly', title: '案件来源'},
                    {align: 'center', field: 'cbje', title: '查补额'},
                    {align: 'center', field: 'rkje', title: '入库额'},
                    {align: 'center', field: 'yjwjsk', title: '已查实并且超过追征期限的应缴未缴税款'},
                    {align: 'center', field: 'qykssjtz', title: '已查实但因企业亏损仅涉及调账'},
                ]];
                elemTmp = 'level3_jccbjfmx_table';
                idTmp = 'level3_jccbjfmx_table';
                pageTmp = true;
                myParesDataFunction = function (res) {
                    return {
                        "code": res.code, //解析接口状态
                        "msg": res.msg, //解析提示文本
                        "count": CoreUtil.isEmpty(res.data) ? 0 : res.data.total, //解析数据长度
                        "data": CoreUtil.isEmpty(res.data) ? null : res.data.records //解析数据列表
                    }
                };
            } else if (event === "JCRKJF") {
                colsTmp = [[
                    {align: 'center', field: 'jcry', title: '检查人员'},
                    {align: 'center', field: 'jcajbh', title: '案件编号'},
                    {align: 'center', field: 'ajmc', title: '案件名称'},
                    {align: 'center', field: 'ajly', title: '案件来源'},
                    {align: 'center', field: 'cbje', title: '查补额'},
                    {align: 'center', field: 'rkje', title: '入库额'},
                    {align: 'center', field: 'yjwjsk', title: '已查实并且超过追征期限的应缴未缴税款'},
                    {align: 'center', field: 'qykssjtz', title: '已查实但因企业亏损仅涉及调账'},
                ]];
                elemTmp = 'level3_jcrkjfmx_table';
                idTmp = 'level3_jcrkjfmx_table';
                pageTmp = true;
                myParesDataFunction = function (res) {
                    return {
                        "code": res.code, //解析接口状态
                        "msg": res.msg, //解析提示文本
                        "count": CoreUtil.isEmpty(res.data) ? 0 : res.data.total, //解析数据长度
                        "data": CoreUtil.isEmpty(res.data) ? null : res.data.records //解析数据列表
                    }
                };
            } else if (event === "AJCCSXJF") {
                colsTmp = [[
                    {align: 'center', field: 'jcajbh', title: '案件编号'},
                    {align: 'center', field: 'ajmc', title: '案件名称'},
                    {align: 'center', field: 'larq', title: '立案时间'},
                    {align: 'center', field: 'zssssj', title: '送审时间（助手）'},
                    {align: 'center', field: 'jcsc', title: '检查时长（助手）'},
                    {align: 'center', field: 'fhjcsj', title: '返回补充稽查时间（助手）'},
                    {align: 'center', field: 'ecsssj', title: '二次送审时间（助手）'},
                    {align: 'center', field: 'sqtsrq', title: '提审时间（三期）'},
                    {align: 'center', field: 'scyqpzrq', title: '首次延期批准时间（三期）'},
                    {align: 'center', field: 'lspzrq', title: '两书批准日期（三期）'},
                    {align: 'center', field: 'zjajpzrq', title: '终结批准时间（三期）'},
                    {align: 'center', field: 'slsc', title: '审理时长（助手）'},
                    {align: 'center', field: 'df', title: '得分'},
                ]];
                elemTmp = 'level3_ajccsxjfmx_table';
                idTmp = 'level3_ajccsxjfmx_table';
                pageTmp = true;
                myParesDataFunction = function (res) {
                    return {
                        "code": res.code, //解析接口状态
                        "msg": res.msg, //解析提示文本
                        "count": CoreUtil.isEmpty(res.data) ? 0 : res.data.total, //解析数据长度
                        "data": CoreUtil.isEmpty(res.data) ? null : res.data.records //解析数据列表
                    }
                };
            } else if (event === "AJDXJF") {
                colsTmp = [[
                    {align: 'center', field: 'jcajbh', title: '案件编号'},
                    {align: 'center', field: 'ajmc', title: '案件名称'},
                    {align: 'center', field: 'ajly', title: '案件来源'},
                    {align: 'center', field: 'ssjdssj', title: '送市局大审时间'},
                    {align: 'center', field: 'ybtse', title: '查补税费合计'},
                    {align: 'center', field: 'ajdx', title: '案件定性'},
                    {align: 'center', field: 'jarq', title: '结案时间'},
                    {align: 'center', field: 'dxdf', title: '得分'},
                ]];
                elemTmp = 'level3_ajdxjfmx_table';
                idTmp = 'level3_ajdxjfmx_table';
                pageTmp = true;
                myParesDataFunction = function (res) {
                    return {
                        "code": res.code, //解析接口状态
                        "msg": res.msg, //解析提示文本
                        "count": CoreUtil.isEmpty(res.data) ? 0 : res.data.total, //解析数据长度
                        "data": CoreUtil.isEmpty(res.data) ? null : res.data.records //解析数据列表
                    }
                };
            } else if (event === "DCHSAJJF") {
                colsTmp = [[
                    {align: 'center', field: 'dchsaybh', title: '调查核实案源编号'},
                    {align: 'center', field: 'dchsqsrq', title: '调查核实起始日期'},
                    {align: 'center', field: 'dchsjsrq', title: '调查核实结束日期'},
                    {align: 'center', field: 'jcks', title: '检查科室'},
                    {align: 'center', field: 'jcry', title: '检查人员'},
                    {align: 'center', field: 'sfla', title: '是否立案'},
                    {align: 'center', field: 'df', title: '得分'},
                ]];
                elemTmp = 'level3_dchsajjfmx_table';
                idTmp = 'level3_dchsajjfmx_table';
                pageTmp = true;
                myParesDataFunction = function (res) {
                    return {
                        "code": res.code, //解析接口状态
                        "msg": res.msg, //解析提示文本
                        "count": CoreUtil.isEmpty(res.data) ? 0 : res.data.total, //解析数据长度
                        "data": CoreUtil.isEmpty(res.data) ? null : res.data.records //解析数据列表
                    }
                };
            } else if (event === "DBAJJF") {
                colsTmp = [[
                    {align: 'center', field: 'jcajbh', title: '案件编号'},
                    {align: 'center', field: 'ajmc', title: '案件名称'},
                    {align: 'center', field: 'ajly', title: '案件来源'},
                    {align: 'center', field: 'larq', title: '立案日期'},
                    {align: 'center', field: 'jcks', title: '检查科室'},
                    {align: 'center', field: 'jcry', title: '检查人员'},
                    {align: 'center', field: 'zjajpzrq', title: '终结案件批准日期'},
                    {align: 'center', field: 'jarq', title: '结案日期'},
                    {align: 'center', field: 'df', title: '得分'}
                ]];
                elemTmp = 'level3_dbajjfmx_table';
                idTmp = 'level3_dbajjfmx_table';
                pageTmp = true;
                myParesDataFunction = function (res) {
                    return {
                        "code": res.code, //解析接口状态
                        "msg": res.msg, //解析提示文本
                        "count": CoreUtil.isEmpty(res.data) ? 0 : res.data.total, //解析数据长度
                        "data": CoreUtil.isEmpty(res.data) ? null : res.data.records //解析数据列表
                    }
                };
            }

            let url = "";
            if (2 == level) {
                url = '/statistics/gzzx/secondLevel';
            } else if (3 == level) {
                url = '/statistics/gzzx/thirdLevel';
            }
            table.render({
                elem: '#' + elemTmp,
                id: idTmp,
                totalRow: totalRowTmp, // 显示总行数
                contentType: 'application/json',
                headers: {
                    "authorization": token
                },
                cols: colsTmp,
                page: pageTmp,// 开启分页
                where: whereParam,
                url: url, //数据接口
                method: 'POST',
                parseData: myParesDataFunction, done: function (res, curr, count) {
                    tableMerge.render(this)
                }
            });
        }

        //点击二级数据下钻列表事件-稽查贡献积分
        table.on('tool(level2_jcgxjf_table)', function (obj) {
            let event = obj.event;
            renderXzTable(obj, 3);
            if (event === "JCCBJF") {
                openXzDiv('稽查查补（退）贡献积分', 'level3_jccbjfmx_div');
            } else if (event === "JCRKJF") {
                openXzDiv('稽查入库贡献积分', 'level3_jcrkjfmx_div');
            }
        });
        //点击二级数据下钻列表事件-执法效能积分
        table.on('tool(level2_zfxnjf_table)', function (obj) {
            let event = obj.event;
            renderXzTable(obj, 3);
            if (event === "AJCCSXJF") {
                openXzDiv('案件查处时限积分', 'level3_ajccsxjfmx_div');
            } else if (event === "AJDXJF") {
                openXzDiv('案件定性积分', 'level3_ajdxjfmx_div');
            }
        });
        //点击二级数据下钻列表事件-其他项目积分
        table.on('tool(level2_qtxmjf_table)', function (obj) {
            let event = obj.event;
            renderXzTable(obj, 3);
            if (event === "DCHSAJJF") {
                openXzDiv('调查核实案件积分', 'level3_dchsajjfmx_div');
            } else if (event === "DBAJJF") {
                openXzDiv('督办案件积分', 'level3_dbajjfmx_div');
            }
        });
    });

    table.on('toolbar(gzzxShowTable)', function (obj) {
        levelFirst_table.reload({
            where: { //设定异步数据接口的额外参数，任意设
                swjgDm: "",
            }
        });
    });

    function skipOpen(gnurl, gnid, title) {
        if (CoreUtil.isEmpty(gnurl) || CoreUtil.isEmpty(gnid) || CoreUtil.isEmpty(title)) {
            return false;
        } else {
            var gnurlArr = gnurl.split(",");
            var gnidArr = gnid.split(",");
            var titleArr = title.split(",");
            for (var i in gnurlArr) {
                tianzhuan(gnurlArr[i], gnidArr[i], titleArr[i])
            }
        }
    }

    function tianzhuan(gnurl, gnid, title) {
        if ($(".layui-tab-title li[lay-id]").length <= 0) {

            var title = "<span>" + title + "</span>";
            active.tabAdd(gnurl, gnid, title);

        } else {
            var isData = false;
            $.each($(".layui-tab-title li[lay-id]"),
                function () {
                    if ($(this).attr("lay-id") == dataid.attr("data-id")) {
                        isData = true;
                    }
                })

            if (isData == false) {
                if (CoreUtil.isEmpty(dataid
                    .attr("data-icon"))) {
                    var title = "<span>"
                        + dataid.attr("data-title")
                        + "</span>";
                    active.tabAdd(dataid.attr("data-url"),
                        dataid.attr("data-id"), title);
                } else {
                    var title = "<span>"
                        + dataid.attr("data-title")
                        + "</span>";
                    title = '<i class="layui-icon '
                        + dataid.attr("data-icon")
                        + '"></i> ' + title;
                    active.tabAdd(dataid.attr("data-url"),
                        dataid.attr("data-id"), title);
                }
            }
        }

        active.tabChange(gnid);
    }

    //触发事件
    let active = {
        tabAdd: function (url, id, title) {
            if (url != "" && url != null && url != undefined) {
                window.parent.layui.element
                    .tabAdd(
                        'tab',
                        {
                            title: title,
                            content: '<iframe data-frameid="'
                                + id
                                + '" frameborder="0" name="content" width="100%" src="'
                                + url + '"></iframe>',
                            id: id
                        })
            }
            FrameWH();//计算框架高度
        },
        tabChange: function (id) {
            //切换到指定Tab项
            window.parent.layui.element.tabChange('tab', id); //切换到：用户管理
            $("iframe[data-frameid='" + id + "']").attr("src",
                $("iframe[data-frameid='" + id + "']").attr("src"))//切换后刷新框架
        },
    };

    function FrameWH() {
        var h = $(window).height();
        $(window.parent.document).find("iframe").css("height", h + "px");
    }

</script>